#!/usr/bin/env node
const { program } = require("commander");
const { createProjectAction, addComponentAction } = require("./core/actions");
const helpOptions = require("./core/help-options");

// 1. 配置所有的options命令
helpOptions();

program
  .command("create <projectName> [...others]")
  .description(
    "create vue project into a folder, 比如: cliutil create my-vue-app"
  )
  .action(createProjectAction);

program
  .command("addcpn <cpnname> [...others]")
  .description(
    "add vue component into a folder, 比如: cliutil addcpn NavBar -d src/components"
  )
  .action(addComponentAction);

program.parse(process.argv); // 解析命令行参数
